<!--  -->
<template>
  <div class="mycourse-page">
    <div class="mycourse-wrap">
      <div class="timeline-wrap w1200">
        <router-link v-for="(router, index) in courseList" :key="`router-${router.question_type}`" :id="`yxp:homeNav${index}`" :to="routerMap[router.question_type + '']" class="title-item synclock">
          <span>{{router.title}}</span>
        </router-link>
      </div>
    </div>
    <section v-if="courseNum === 0" class="empty0-section">
      <img src="~assets/course/empty.png" alt="" />
      <span class="empty-message">暂无课程~</span>
    </section>
    <div class="mycourse-footer">
      <Footer></Footer>
    </div>
  </div>
</template>

<script>
  import { fetchCourse } from "@/services";
  import { Timeline, Tooltip } from "ant-design-vue";
  import Footer from "@/components/layout/Footer";

  import { mapState } from "vuex";
  import { SUCCESS_CODE } from "@/utils/const";
  const qs = require("querystring");

  export default {
    name: "myCourse",
    components: {
      ATimeline: Timeline,
      ATimelineItem: Timeline.Item,
      ATooltip: Tooltip,
      Footer
    },
    data() {
      return {
        padUrl: process.env.VUE_APP_PADURL,
        modalVisible: false,
        todayCourse: [],
        calendarData: [],
        courseList: [],
        calendarTable: [],
        livingCurr: "",
        courseNum: 0,
        routerMap:{
          "0": '/wordRemember',
          "3": '/reverse',
          "1": '/super-read',
          "4": '/composition'
        },
        originData: {}
      };
    },
    computed: {
      ...mapState({
        userInfo: state => state.userInfo
      })
    },
    watch: {},
    methods: {
    },
    created() {
      fetchCourse({
        class_num: '32253093516318724525420322530',
      }).then((res) => {
        if (res.code === SUCCESS_CODE) {
          this.courseList = res.data;
        }
      });
    },
    mounted() {

    },
    beforeCreate() {},
    beforeMount() {},
    beforeUpdate() {},
    updated() {},
    beforeDestroy() {}
  };
</script>
<style lang="less" scoped>
  /* @import url(); 引入公共css类 */
  @import url("./index.less");
</style>
